export const performScriptForEval = (script, appName, global) => {
    window.proxy = global
    const scriptText = `
        return ((window) => {
            ${script}
            return window['${appName}']
        })(window.proxy)
    `
    return eval(scriptText)
}

export const performScriptForFunction = (script, appName, global) => {
    window.proxy = global
    const scriptText = `
       return ((window) => {
            ${script}
            return window['${appName}']
        })(window.proxy)
    `
    return new Function(scriptText)()
}
